<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>
<script type="text/javascript">
    var G_ADVANCED_EDITOR_ENABLE = "<?php echo get_setting('advanced_editor_enable'); ?>";
</script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/ueditor/ueditor.config.js?20170821"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/ueditor/ueditor.all.js?20170821"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/ueditor/lang/zh-cn/zh-cn.js?20170821"></script>
<script type="text/javascript" src="<?php echo G_STATIC_URL; ?>/js/app/publishs.js"></script>
<div class="aw-content-wrap">
	<form id="settings_form" action="admin/ajax/save_share_settings/" method="post" onsubmit="return false;">
		<div class="mod">
			<div class="mod-head">
				<h3>
					<ul class="nav nav-tabs">
						<li><a href="admin/user/share_setting/"><?php _e('分享配置'); ?></a></li>
					</ul>
				</h3>
			</div>
			<div class="tab-content mod-content">
				<div class="tab-pane active">
					<div class="table-responsive">
						<table class="table table-striped">
							<tbody>
							<tr>
								<td>
								    <div class="form-group">
							      		  <span class="col-sm-3 col-xs-3 control-label"><?php _e('分享内容：'); ?></span>
									      <div class="col-sm-5 col-xs-8">
									        	<input name="share_content" type="text"  class="form-control" value="<?php echo ($this->setting['share_content']); ?>"/>
									      </div>
								    </div>
								</td>
							</tr>
							<tr>
								<td>
									<div class="form-group">
										<span class="col-sm-4 col-xs-3 control-label"><?php _e('邀请好友规则配置：'); ?></span>
										<div class="aw-mod aw-editor-box" style="margin:0 auto;width: 800px; ">
											<div class="mod-head">
												<div class="wmd-panel">
													<script class="wmd-input fuwenben" style="display: block" id="container" rows="15" name="invitation_code_remark"><?php echo htmlspecialchars_decode($this->setting['invitation_code_remark']); ?></script></p>
												</div>
											</div>
										</div>
									</div>
								</td>
							</tr>
							<tr>
								<td>
									<div class="form-group">
										<span class="col-sm-4 col-xs-3 control-label"><?php _e('邀请海报背景图'); ?>:</span>
										<div class="col-sm-2"  style="display:inline-block">
											<p>
												<img src="/uploads/poster/bg/poster_bg.jpg" alt="" width="180" height="320" class="img-polaroid" />
											</p>
											<span class="mod-file">
												<input type="button" class="btn btn-primary" value="点击更换海报">
												<input type="file" name="poster_bg_img" exts="png|jpg|jpeg" class="mod-input-file">
											</span>
											<br>
											<span class="help-block"><?php _e('图片尺寸宽高为：1080 * 1920 PX；图片类型：png、jpg、jpeg'); ?></span>
										</div>
										<div class="col-sm-2" style="display:inline-block">
											<span>
												<img src="<?php echo G_STATIC_URL ?>/common/poster.jpg" alt="" width="180" height="320" class="img-polaroid" />
											</span>
											<span class="help-block"><?php _e('示例图片：图中二维码和用户名为动态生成，所占空白位置在背景图中需要固定在这个位置'); ?></span>
										</div>
									</div>
								</td>
							</tr>
							</tbody>
						</table>

					</div>
				</div>
			</div>

			<div class="tab-content mod-content mod-one-btn">
				<div class="center-block">
					<input type="button" value="保存设置" class="btn btn-primary" onclick="save_share_setting();">
				</div>
			</div>

		</div>
	</form>
</div>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>

<script>
    function save_share_setting(){
        if($('input[name="share_content"]').val()==''){
            AWS.alert("请输入分享内容");
            return false;
        }
        if($('input[name="share_title"]').val()==''){
            AWS.alert("请输入分享摘要");
            return false;
        }
        AWS.ajax_post($('#settings_form'));
    }
</script>